#include "product.h"
#include <QDebug>

Product::~Product()
{

}

void Product::ProducePart(QString part)
{
    qDebug()<<"build part of Product";
    ProductPart* p = new ProductPart(part);

    if(part=="head")
        m_head = p->BuildPart();
    else if(part=="face")
        m_face = p->BuildPart();
    else if(part=="eye")
        m_eye = p->BuildPart();

    delete p;
    p = nullptr;
}

Product::Product()
{
    m_head = m_face = m_eye = "";
}

ProductPart::ProductPart(QString part)
{
    _part = part;
}

ProductPart::~ProductPart()
{

}

QString ProductPart::BuildPart()
{
    return "qrc:/images/"+_part+".png";
}
